<!DOCTYPE html>
<html>
<head>
    <#include "/layout/baseHeader.ftl" />
</head>
<body>
<div id="app" v-cloak>
    <i-form ref="mySearchForm" :model="searchForm" :label-width="80">
        <Row>
            <i-col span="6">
                <Form-item label="超级密码">
                    <i-input v-model="searchForm.pwd" placeholder="请输入"></i-input>
                </Form-item>
            </i-col>
            <i-col span="6">
            </i-col>
            <i-col span="6">
            </i-col>
            <i-col span="6">
            </i-col>
        </Row>
    </i-form>
    <div class="g-dg-toolbar">
        <i-button type="info" icon="search" @click="execute">执行</i-button>
    </div>
    <Row :gutter="24" class="g-fixgutter">
        <i-col span="12">
            <i-input v-model="searchForm.sql" type="textarea" :rows="20" placeholder="请在这里输入"></i-input>
        </i-col>
        <i-col span="12">
            <i-input v-model="result" type="textarea" :rows="20" placeholder="这里返回json，请自己上网找方法格式化"></i-input>
        </i-col>
    </Row>
</div>
</div>
<script>
    const m_apis = {
        execute(p_form) {
            return PB.apiRoute('/api/sys/user/sql', 'POST', p_form)
        }
    };
    let vu = new Vue({
        el: '#app',
        data: {
            searchForm: {},
            result: '',
            apis: m_apis
        },
        created() {

        },
        methods: {
            execute() {
                let that = this;
                PB.ajax(this.apis.execute(this.searchForm), function (d) {
                    that.result = JSON.stringify(d.data);
                });
            }
        }
    })

</script>
</body>
</html>
